﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;

namespace BorderForScreen
{
    class Program
    {
        static void Main(string[] args)
        {
            DrawBorder(10, 5, 20, 20, '*');
            Console.ReadKey();
        }

        public static void DrawBorder(int x, int y, int height, int width, char ch)
        {
            height++;
            width++;
            for (int i = 0; i < height; i++)
            {
                Console.SetCursorPosition(x, y);
                for (int j = 0; j < width; j++)
                {
                    if (i == 0 || i == height - 1)
                    {
                        Console.Write(ch);
                    }
                        
                    else if (j == 0 || j == width - 1)
                        Console.Write(ch);
                    else
                    {
                        Console.Write(' ');
                    }
                }
                y++;
                Console.WriteLine();
            }
        }
    }
}
